---
title: 超链接
icon: Link
---

<MetaData
  lang="zh-CN"
  meta={{
    preset: [{
      client: '@univerjs/preset-docs-hyper-link',
      locale: '@univerjs/preset-docs-hyper-link/locales/zh-CN',
      style: '@univerjs/preset-docs-hyper-link/lib/index.css',
    }],
    plugins: [{
      client: '@univerjs/docs-hyper-link',
    }, {
      client: '@univerjs/docs-hyper-link-ui',
      locale: '@univerjs/docs-hyper-link-ui/locale/zh-CN',
      style: '@univerjs/docs-hyper-link-ui/lib/index.css',
    }],
    server: '否',
  }}
/>

超链接用于实现文档外部网页、电子邮件地址等内容的快速跳转与访问。

## 预设模式

### 安装

```package-install
npm install @univerjs/preset-docs-hyper-link
```

### 使用

```typescript
import { UniverDocsCorePreset } from '@univerjs/preset-docs-core'
import UniverPresetDocsCoreZhCN from '@univerjs/preset-docs-core/locales/zh-CN'
import { UniverDocsHyperLinkPreset } from '@univerjs/preset-docs-hyper-link' // [!code ++]
import UniverPresetDocsHyperLinkZhCN from '@univerjs/preset-docs-hyper-link/locales/zh-CN' // [!code ++]
import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets'

import '@univerjs/preset-docs-core/lib/index.css'
import '@univerjs/preset-docs-hyper-link/lib/index.css' // [!code ++]

const { univerAPI } = createUniver({
  locale: LocaleType.ZH_CN,
  locales: {
    [LocaleType.ZH_CN]: mergeLocales(
      UniverPresetDocsCoreZhCN,
      UniverPresetDocsHyperLinkZhCN, // [!code ++]
    ),
  },
  presets: [
    UniverDocsCorePreset(),
    UniverDocsHyperLinkPreset(), // [!code ++]
  ],
})
```

{/* ### 预设与配置 */}

## 插件模式

### 安装

```package-install
npm install @univerjs/docs-hyper-link @univerjs/docs-hyper-link-ui
```

### 使用

```typescript
import { LocaleType, mergeLocales, Univer } from '@univerjs/core'
import { UniverDocsHyperLinkPlugin } from '@univerjs/docs-hyper-link' // [!code ++]
import { UniverDocsHyperLinkUIPlugin } from '@univerjs/docs-hyper-link-ui' // [!code ++]
import DocsHyperLinkUIZhCN from '@univerjs/docs-hyper-link-ui/locale/zh-CN' // [!code ++]

import '@univerjs/docs-hyper-link-ui/lib/index.css' // [!code ++]

const univer = new Univer({
  locale: LocaleType.ZH_CN,
  locales: {
    [LocaleType.ZH_CN]: mergeLocales(
      DocsHyperLinkUIZhCN, // [!code ++]
    ),
  },
})

univer.registerPlugin(UniverDocsHyperLinkPlugin) // [!code ++]
univer.registerPlugin(UniverDocsHyperLinkUIPlugin) // [!code ++]
```

{/* ### 插件与配置 */}
